<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<jsp:include page="common/header.jsp"></jsp:include>

<input type="hidden" name="projectName" id="projectName" value="${pageContext.request.contextPath }"/>

<h1><img src="${pageContext.request.contextPath}/views/images/icons/posts.png" alt="" /> 角色管理</h1>

<a id="button_add" class="mypage_button" href="${pageContext.request.contextPath}/admin-role/add"><img src="${pageContext.request.contextPath}/views/images/icons/menu/dark/chart.png"/> 添加</a>

<div class="bloc">
    <div class="title">
       角色列表
    </div>
    <div class="content" >
        <table>
            <thead>
                <tr>
                    <th><input type="checkbox" class="checkall"/></th>
                    <th>名称</th>
                    <th>描述</th>
                    <th style="text-align:center;">操作</th>
                </tr>
            </thead>
            <tbody>
            	<c:forEach items="${roles}" var="item">
            		<tr>
	                    <td><input type="checkbox" /></td>
	                    <td>${item.name}</td>
	                    <td>${item.description}</td>
	                    <td class="actions"><a href="${pageContext.request.contextPath}/admin-role/update?id=${item.id }"><img src="${pageContext.request.contextPath}/views/images/icons/actions/edit.png" alt="" /></a><a href="javascript:deleterole(${item.id }, '${item.name }');" ><img src="${pageContext.request.contextPath}/views/images/icons/actions/delete.png" alt="" /></a></td>
	                </tr>
            	
            	</c:forEach>
                            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/views/js/role.js"></script>